/************************************************************************
*
*    File Name: bullet.cpp
*    Description: 子弹类，加载子弹图片，连接计时器
*    Version: V2.0
*    Author: 王涵
*    Create Time: 2024-11-27
*
*************************************************************************/
#include "bullet.h"

Bullet::Bullet(QObject *parent) : QObject(parent),QGraphicsPixmapItem()
,speed(BULLET_SPEED)
{
    setPixmap(QPixmap(BULLET_PATH).scaled(BULLET_WIDTH,BULLET_HEIGHT));

    QTimer *timer = new QTimer(this);
    connect(timer,&QTimer::timeout,this,&Bullet::bullet_move);
    timer->start(32);
}
